package com.futao.springbootlearn20220224.async;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * @author futao@gmail.com
 * @date 2022/3/9
 */
@Component
public class AsyncCall implements ApplicationRunner {

    @Autowired
    private AsyncTask asyncTask;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        for (int i = 0; i < 20; i++) {
            asyncTask.task2();
        }
    }
}
